<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../../public/templateMenu.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://primefaces.org/ui">

    <ui:define name="conteudo">
        <h:form>
            <p:panel header="Lista de Crianças Achadas">

                <p:dataTable id="dtCriancas" var="crianca"
                             value="#{criancaBean.criancas}" 
                             paginator="true" rows="5"
                             style="width: auto;height: auto" 
                             emptyMessage="Sem Registros">

                    <p:column headerText="Nome" >
                        <h:outputText value="#{crianca.nome}"/>
                    </p:column>
                    <p:column headerText="Responsavel">
                        <h:outputText value="#{crianca.responsavel.nome}"/>

                    </p:column>
                    <p:column headerText="Ambiente">
                        <h:outputText value="#{crianca.ambiente.nome}"/>
                    </p:column>
                </p:dataTable>


            </p:panel>
            <div align="south">

                        <h:panelGrid columns="6">
                            <p:commandButton value="Cadastrar Criança" 
                                             action="/cadastro/crianca/formularioCrianca.xhtml"/>
                            <p:commandButton value="Cadastrar Responsável" 
                                             action="/cadastro/responsavel/formularioResponsavel.xhtml"/>
                        </h:panelGrid>
                    </div>
        </h:form>
    </ui:define>

</ui:composition>
